//- 先去这个pug文件中找
extends shopHead_nav.pug

block append pageStyle
	link(href="${relativePath}/static/css/shopping/shopIndex.css" rel="stylesheet" type="text/css")
	link(href="${relativePath}/static/css/shopping/materFinished.css" rel="stylesheet" type="text/css")
	link(href="${relativePath}/static/css/shopping/service.css" rel="stylesheet" type="text/css")
	link(href="${relativePath}/static/css/shopping/serviceIndex.css" rel="stylesheet" type="text/css")

block matrialContent
	//- 成品材料内容
	div.matrialCon.layout
		h3.bigTitle 广告设计
		//- 广告设计发表需求列表
		div.demandList.clear
			ul.clear.designOne
				//- li
				//- 	a(href="javascript:;")
				//- 		img(src="${relativePath}/static/imgs/process-MG-01.png")
				//- 		div.demainBox
				//- 			div.fbDemain
				//- 				span.fl 发布需求
				//- 				i.fr 2173人付款
				//- 			p.release 跟据自己的需求发布订单
				//- 			div.orderBox
				//- 				span.setCommon.chat 聊天
				//- 				span.setCommon.order.current 下单
				//- li
				//- 	a(href="javascript:;")
				//- 		img(src="${relativePath}/static/imgs/process-MG-02.png")
				//- 		div.demainBox
				//- 			div.fbDemain
				//- 				span.designName.fl 标识设计
				//- 				i.fr 11.11km
				//- 			p.release
				//- 				a.address.fl(href="javascript:;") 郑东新区商鼎路
				//- 				span.follow.current.fr 已关注
				//- 			div.orderBox
				//- 				span.setCommon.chat 聊天
				//- 				span.setCommon.order 下单
			a(href="industryService.html").moreBtn 更多>>

		h3.bigTitle 广告安装
		//- 安装发表需求列表
		div.demandList.clear
			ul.clear.installOne
			a(href="industryService_install.html").moreBtn 更多>>
		//- 车辆设备安装
		h3.bigTitle 车辆租赁
		//- 安装发表需求列表
		div.demandList.clear
			ul.clear.carList
				
			a(href="industryService_car.html").moreBtn 更多>>
		h3.bigTitle 设备租赁
		div.demandList.clear
			ul.clear.carList1
			a(href="industryService_eq.html").moreBtn 更多>>
	//- 广告设计模板
	script#designMB(type="text/html")
		| {{set designData = data.design}}
		| {{each designData temp}}
		li(id="{{temp.member_id}}"  type_id="{{temp.type_id}}"  cate_id="{{temp.category_id}}")
			a.bbxImg(href="javascript:;" style="background: url('{{temp.avatar_img}}') no-repeat 0 center")
			div.demainBox
				| <div class="fbDemain"{{if temp.is_identification == 2}}class="designName"{{/if}}>
				| <span class="fl"> {{temp.company_name}}</span>
				| </div>
				p.release
					| {{if temp.cur_city == ""}}
					a.address.fl(href="javascript:;") 无
					| {{else}}
					a.address.fl(href="javascript:;") {{temp.cur_city}}
					| {{/if}}
					| {{if temp.company_name == 1}}
					span.follow.current.fr 已关注
					| {{else}}
					span.follow.fr 关注
					| {{/if}}
				div.orderBox
					span.setCommon.chat 聊天
					span.setCommon.order 下单
		| {{/each}}

	//- 广告安装模板
	script#installMB(type="text/html")
		| {{set designData = data.install}}
		| {{each designData temp}}
		li(id="{{temp.member_id}}"  type_id="{{temp.type_id}}"   cate_id="{{temp.category_id}}")
			a.bbxImg(href="javascript:;" style="background: url('{{temp.avatar_img}}') no-repeat 0 center")
			div.demainBox
				| <div class="fbDemain"{{if temp.is_identification == 2}}class="designName"{{/if}}>
				| <span class="fl"> {{temp.company_name}}</span>
				| </div>
				p.release
					| {{if temp.cur_city == ""}}
					a.address.fl(href="javascript:;") 无
					| {{else}}
					a.address.fl(href="javascript:;") {{temp.cur_city}}
					| {{/if}}
					| {{if temp.company_name == 1}}
					span.follow.current.fr 已关注
					| {{else}}
					span.follow.fr 关注
					| {{/if}}
				div.orderBox
					span.setCommon.chat 聊天
					span.setCommon.order 下单
		| {{/each}}
	//- 车辆租赁模板
	script#carMB(type="text/html")
		| {{set designData = data.car}}
		| {{each designData temp}}
		li(id="{{temp.member_id}}" type_id="{{temp.type_id}}" cate_id="{{temp.category_id}}"  cateid="{{temp.parent_id}}")
			a.bbxImg(href="javascript:;" style="background: url('{{temp.avatar_img}}') no-repeat 0 center")
			div.demainBox
				| <div class="fbDemain"{{if temp.is_identification == 2}}class="designName"{{/if}}>
				| <span class="fl"> {{temp.company_name}}</span>
				| </div>
				p.release
					| {{if temp.cur_city == ""}}
					a.address.fl(href="javascript:;") 无
					| {{else}}
					a.address.fl(href="javascript:;") {{temp.cur_city}}
					| {{/if}}
					| {{if temp.company_name == 1}}
					span.follow.current.fr 已关注
					| {{else}}
					span.follow.fr 关注
					| {{/if}}
				div.orderBox
					span.setCommon.chat 聊天
					span.setCommon.order 下单
		| {{/each}}
	//- 设备租赁模板
	script#equipMB(type="text/html")
		| {{set designData = data.device}}
		| {{each designData temp}}
		li(id="{{temp.member_id}}" type_id="{{temp.type_id}}"  cate_id="{{temp.category_id}}" cateid="{{temp.parent_id}}")
			a.bbxImg(href="javascript:;" style="background: url('{{temp.avatar_img}}') no-repeat 0 center")
			div.demainBox
				| <div class="fbDemain"{{if temp.is_identification == 2}}class="designName"{{/if}}>
				| <span class="fl"> {{temp.company_name}}</span>
				| </div>
				p.release
					| {{if temp.cur_city == ""}}
					a.address.fl(href="javascript:;") 无
					| {{else}}
					a.address.fl(href="javascript:;") {{temp.cur_city}}
					| {{/if}}
					| {{if temp.company_name == 1}}
					span.follow.current.fr 已关注
					| {{else}}
					span.follow.fr 关注
					| {{/if}}
				div.orderBox
					span.setCommon.chat 聊天
					span.setCommon.order 下单
		| {{/each}}

block append pageScript
	script.
		$(function(){
			$("#hyfw1").addClass("active");
			$("#cpcl").click(function(){
				window.location.href='materFinished.html';
			});
			$("#index").click(function(){
				window.location.href='materIndex.html';
			});
			
			$(".left span").click(function(){
				$(this).addClass("current").siblings().removeClass("current");
			})

			//- 点击商品收藏
			$(".btnProduct .sc").on("click",function(){
				if($(this).hasClass("current")) {
					$(this).removeClass('current');
				}else{
					$(this).addClass('current');
				}
			})

			/*点击关注*/
			$("div.demandList").on("click",".release .follow",function(){
				var $this = $(this);
				if($(this).hasClass("current")) {
					$(this).text("关注");
					$(this).removeClass('current');
					$.post(shopIp+"/Concern/concern",{
						userToken:token,
						concern_id:$this.closest("li").attr("id")
					},function(data) {
						layer.msg(data.msg);
					})
				}else{
					$(this).text("已关注");
					$(this).addClass('current');
					$.post(shopIp+"/Concern/concern",{
						userToken:token,
						concern_id:$this.closest("li").attr("id")
					},function(data) {
						layer.msg(data.msg);
					})
				}
			})
			//- 点击安装列表
			$(".installNav li").click( function(){
				$(this).addClass("active").siblings().removeClass("active");
			})

			//- 广告设计列表获取
			$.post(shopIp+"/category/servicesIndustry",{
				userToken:token
			},function(data) {
				var design = template("designMB",data);
				var install = template("installMB",data);
				var car = template("carMB",data);
				var equip = template("equipMB",data);
				//console.log(design);
				$(".designOne").append(design);
				$(".installOne").append(install);
				$(".carList").append(car);
				$(".carList1").append(equip);
			})

			//- 点击跳转
			$(".demandList").on("click",".fbDemain",function() {
				window.location.href = "rightOrder.html?id="+$(this).closest("li").attr("id")+"&typeId="+$(this).closest("li").attr("type_id");
			})
			//- 点击下单
			$(".designOne").on("click",".order",function() {
				window.location.href = "designNeeds.html?id="+$(this).closest("li").attr("id")+"&cateid="+$(this).closest("li").attr("cate_id");
			})
			$(".installOne").on("click",".order",function() {
				window.location.href = "installNeeds.html?id="+$(this).closest("li").attr("id")+"&cateid="+$(this).closest("li").attr("cate_id");
			})
			$(".carList").on("click",".order",function() {
				window.location.href = "carNeeds.html?parent_id="+$(this).closest("li").attr("cateid")+"&id="+$(this).closest("li").attr("id")+"&cate_id="+$(this).closest("li").attr("cate_id");;
			})
			$(".carList1").on("click",".order",function() {
				window.location.href = "equiNeeds.html?parent_id="+$(this).closest("li").attr("cateid")+"&id="+$(this).closest("li").attr("id")+"&cate_id="+$(this).closest("li").attr("cate_id");;
			})
		})